//
// Created by xuan on 23-12-12.
//

#ifndef GYRO_A100_UPRE_GYRO100A_H
#define GYRO_A100_UPRE_GYRO100A_H

#include "main.h"
#include "UPRE_GLOBAL_DEFINE.h"
#include "stdbool.h"

#define GYRO_FACTOR       				14078.5f  //166516    2000
#define GYRO_EARTH_SPEED  				0.00000131f//0.00000052621f
#define GYRO_TIME         				0.0005f
#define GYRO_TEMPERATURE_COEFFICIENT	0.0625f
//#define GYRO_COMPENSATION               0.00000001

#define GYRO_RECIVE 1

typedef struct Gyro
{
//    uint8_t Gyro_Data[BUFFER_SIZE];
    uint8_t State;
    float Angle_pitch;		//俯仰角
    float Angle_roll;		//横滚角
    float Angle_azimuth;	//方位角
    float Delata_Angle;		//方位角变化值
    float W_x;				//惯导角速率
    float W_y;
    float W_z;
    float A_x;				//惯导加速度
    float A_y;
    float A_z;
}Gyro;
extern struct Gyro gyro;
extern struct GYRO_100A gyro_100A;
typedef struct GYRO_100A
{
    uint8_t gyro_buffer[8];
    uint8_t gyro_location;      //数组位置
    int gyro_original_angle;
    int gyro_original_temperature;
    float gyro_angle_s;
    float gyro_angle;               //陀螺仪偏转角
    float gyro_temperature;
    float gyro_angleDate;
    float gyro_delta_angle;
    float gyro_last_angle;
}_gyra_100A;

void GYRO_A100_Init(void);
void get_gyroValue(void);
float returnyaw(void);

#endif //GYRO_A100_UPRE_GYRO100A_H
